<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of evaluation_appraisal
 *
 * @author wilavel
 */
class EvaluationAppraisal extends AppModel {

    //put your code here
    var $name = "EvaluationAppraisal";
    var $actsAs = array('Logable' => array(
            'userModel' => 'User',
            'userKey' => 'user_id',
            'change' => 'full', // options are 'list' or 'full'
            'description_ids' => TRUE // options are TRUE or FALSE
            ));
    var $belongsTo = array('Property', 'Departament', 'City');
    var $hasMany = array(
        "EvaluationAnnex" =>
        array(
            'dependent' => true
        ),
        "EvaluationPhysiographicUnit" =>
        array(
            'dependent' => true
        ),
        "InitialEvaluationAnnex" =>
        array(
            'dependent' => false
        ),
        "FinalEvaluationAnnex" =>
        array(
            'dependent' => false
        )
    );
    var $validate = array(
        'area' => array('rule' => 'numeric', 'required' => true, 'message' => 'Este campo es obligatorio. Debe ser un número'),
        'valor' => array('rule' => 'numeric', 'required' => true, 'message' => 'Este campo es obligatorio. Debe ser un número'),
        'city_id' => array('rule' => 'notEmpty', 'required' => true, 'message' => 'Este campo es obligatorio. Debe seleccionar de nuevo el departamento.')
    );

}

?>
